<?php


namespace app\index\model;


use think\Model;
use think\Db;

class Prices extends Model
{

    //增加项目收费
        /*$str = "INSERT INTO xt_xmsf (yqdh,xmdh,brlb,xmsf,gzl,khdh,starttime,endtime,dq,pv,jb,sfts,xjsf,cbje,city)
VALUES('手工免疫','300008','[none]','300008.00','0',null,'2019-04-01 00:00:00.000','2024-01-01 00:00:00.000',
NULL,'6','1',null,null,null,null)";*/

        //这儿有两种收费方式 维护  一种单项  默认时间 ts '2020-01-01 00:00:00.000'}, // {ts '2099-12-31 00:00:00.000'}, '6', '3' )

    //单项
    public  function AddXmsf($yqdh, $xmdh, $xmsf)
    {
          $res3 = Db::execute("INSERT INTO xt_xmsf ( yqdh, xmdh, brlb, xmsf, gzl, khdh,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :xmdh, '[none]', :xmsf, 1, '',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '3' ),['yqdh'=>$yqdh,'xmdh'=>$xmdh,'xmsf'=>$xmsf]");

          //二级
        $res2 = Db::execute("INSERT INTO xt_xmsf ( yqdh, xmdh, brlb, xmsf, gzl, khdh,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :xmdh, '[none]', :xmsf, 1, '',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '2' ),['yqdh'=>$yqdh,'xmdh'=>$xmdh,'xmsf'=>$xmsf]");

        //一级
        $res1 = Db::execute("INSERT INTO xt_xmsf ( yqdh, xmdh, brlb, xmsf, gzl, khdh,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :xmdh, '[none]', :xmsf, 1, '',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '1' ),['yqdh'=>$yqdh,'xmdh'=>$xmdh,'xmsf'=>$xmsf]");
        if($res1&$res2&$res3){
            return true;
        }
        return false;
    }


    //添加组套
    public  function AddXmzhsf($yqdh,$zhdh,$zhsf)
    {
        $res3 = Db::execute("INSERT INTO xt_xmzhsf ( yqdh, zhdh, brlb, zhsf,  khmc,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :zhdh, '[none]',:zhsf, '6D1003',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '3' ),['yqdh' =>$yqdh,'zhdh'=>$zhdh,'zhsf'=>$zhsf]");
        $res2 = Db::execute("INSERT INTO xt_xmzhsf ( yqdh, zhdh, brlb, zhsf,  khmc,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :zhdh, '[none]',:zhsf, '6D1003',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '3' ),['yqdh' =>$yqdh,'zhdh'=>$zhdh,'zhsf'=>$zhsf]");
        $res1 = Db::execute("INSERT INTO xt_xmzhsf ( yqdh, zhdh, brlb, zhsf,  khmc,starttime, endtime, pv, jb )
 VALUES ( :yqdh, :zhdh, '[none]',:zhsf, '6D1003',{ts '2020-01-01 00:00:00.000'}, 
 {ts '2099-12-31 00:00:00.000'}, '6', '3' ),['yqdh' =>$yqdh,'zhdh'=>$zhdh,'zhsf'=>$zhsf]");

        if($res1&$res2&$res3){
            return true;
        }
        return false;
    }






}